package com.javakc.pms.dispord.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * 描述：
 */
@Setter
@Getter
@Entity
@Table(name = "dispatch_order_bank")
@EntityListeners(AuditingEntityListener.class)
public class DispOrd {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    /**
     * 指令名称
     */
    @Column(name = "order_name")
    private String orderName;
    /**
     * 优先级
     */
    @Column(name = "order_priority")
    private int orderPriority;
    /**
     * 指令专业类型
     */
    @Column(name = "order_type")
    private String orderType;
    /**
     * 指令描述
     */
    @Column(name = "order_reason")
    private String orderReason;

    @CreatedDate
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Column(name = "created_time",updatable = false)
    private Date createdTime;

    @LastModifiedDate
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Column(name = "updated_time",insertable = false)
    private Date updatedTime;
}
